﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace TextAnalyzer
{
    internal class PostfixViewModel:INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private string mValue = null;
        private bool mCaseComparison = false;
        private string mParent = null;
        public string Value
        {
            get
            {
                return mValue;
            }
            set
            {
                mValue = value;
                RaisePropertyChanged("Value");
            }
        }
        public bool CaseComparison
        {
            get
            {
                return mCaseComparison;
            }
            set
            {
                mCaseComparison = value;
                RaisePropertyChanged("CaseComparison");
            }
        }
        public string Parent
        {
            get
            {
                return mParent;
            }
            set
            {
                mParent = value;
                RaisePropertyChanged("Parent");
            }
        }
        public PostfixViewModel() { }
        public PostfixViewModel(string strValue, bool bCaseComparison, string strParent)
        {
            mValue = strValue;
            mCaseComparison = bCaseComparison;
            mParent = strParent;
        }
        private void RaisePropertyChanged(string strPropertyName)
        {
            PropertyChangedEventHandler _handler = this.PropertyChanged;
            if (null != _handler) _handler(this, new PropertyChangedEventArgs(strPropertyName));
        }
    }
}
